/*
 * @Descripttion: 
 * @version: 
 * @Author: kl2018
 * @Date: 2020-05-22 16:59:23
 * @LastEditors: kl2018
 * @LastEditTime: 2020-06-23 09:49:36
 */
import React, { Component } from 'react';
import { inject, observer } from 'mobx-react'

import Append from './append';
import AppendSelf from './appendSelf';

/**
 * 给流程追加意见
 * 加操作者，或者减少操作者，或者修改状态
 */
@inject("odocCompsStore")
@observer
class Index extends Component {
	componentWillMount() {
		this.loadData();
	}

	loadData = () => {
		const { odocCompsStore = {} } = this.props;
		try {
			const { workflowStores = {} } = odocCompsStore;
			const { globalStore = {} } = workflowStores;
			const { loadMarkInfo } = globalStore;
			loadMarkInfo();
		} catch (e) {
		}
	}

	render() {
		const { odocCompsStore = {} } = this.props;
		let wfmonitor = false;
		try {
			const { workflowStores = {} } = odocCompsStore;
			const { globalStore = {} } = workflowStores;
			const { commonParam = {} } = globalStore;
			const { wfmonitor: wfm = false } = commonParam;//是否是流程监控页面
			wfmonitor = wfm;
		} catch (e) {
		}
		if (wfmonitor) {//是监控
			return <Append {...this.props} />
		} else {//不是监控仅能为自己添加签字意见
			return <AppendSelf {...this.props} />
		}
	}
}

export default Index